//
//  HomeScreenViewController.m
//  ExhibitForcePrototype
//
//  Created by Dilyana Todorova on 12/5/12.
//  Copyright (c) 2012 Dilyana Todorova. All rights reserved.
//

#import "HomeScreenViewController.h"
#import "MMScanBadgeViewController.h"
#import "SettingsViewController.h"
#import "ContentViewController.h"
#import "AnalyticsViewController.h"
#import "MainTabBarController.h"


@interface HomeScreenViewController ()<MMScanBadgeDelegate>
@property (nonatomic, weak) IBOutlet UIButton * scanBadgeButton;
@property (nonatomic, weak) IBOutlet UIButton * skipScanButton;

@end

@implementation HomeScreenViewController

@synthesize scanBadgeButton, skipScanButton;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
    self.scanBadgeButton = nil;
    self.skipScanButton = nil;
}

#pragma mark - actions
- (IBAction)scanBadge:(UIButton *) button{
    MMScanBadgeViewController * scanBadgeViewController = [[MMScanBadgeViewController alloc] init];
    scanBadgeViewController.delegate = self;
    [self.navigationController pushViewController:scanBadgeViewController animated:YES];
}

- (IBAction)skipScanBadge:(UIButton *) button{
    MainTabBarController * menuViewController = [[MainTabBarController alloc] init];
    [self.navigationController pushViewController:menuViewController animated:YES];
}

#pragma mark - MMScanBadgeDelegate
-(void) scanFinished
{
    //[self.navigationController popViewControllerAnimated:YES];

    [self.navigationController popToRootViewControllerAnimated:NO];
    MainTabBarController * menuViewController = [[MainTabBarController alloc] init];
    [self.navigationController pushViewController:menuViewController animated:YES];
        
    
}
@end
